/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.its.dsw2.view;

import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import mx.its.dsw2.biblioteca.bl.LibroBlLocal;
import mx.its.dsw2.biblioteca.modelo.Libro;

/**
 *
 * @author Maq.8
 */
@ManagedBean
@SessionScoped
public class AccessBean {

    private String user = "";
    private String password = "";

    /**
     * Creates a new instance of AccessBean
     */
    public AccessBean() {
    }

   

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUser() {
        return user;
    }

    public void setUser(String user) {
        this.user = user;
    }

 
    //------------------ACTION---------------------

    public String actionProcess() {
        FacesContext context = FacesContext.getCurrentInstance();
        context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO", user);
        
        if (user.equals("root") && password.equals("12345")) {
            return "MenuPrincipal";
        } else {
            return "Login";
        }
    }
      
}
